Skip to content

docs: resolve API drift in pkg/parser, pkg/workflow, pkg/cli, pkg/console#29925

Merged
pelikhan merged 2 commits into
mainfrom
copilot/fix-api-drift-in-packages
May 3, 2026
Merged

docs: resolve API drift in pkg/parser, pkg/workflow, pkg/cli, pkg/console#29925
pelikhan merged 2 commits into
mainfrom
copilot/fix-api-drift-in-packages

Conversation

Copilot AI commented May 3, 2026

Copy link
Copy Markdown
Contributor

The spec-extractor workflow flagged 4 packages where source code outgrew their README.md specifications (completeness scores: cli 70%, parser 80%, workflow 75%, console 95%).

Changes

pkg/parser/README.md

  • Added InlineSubAgent struct to the Types table
  • New Inline Sub-Agent Processing subsection documents the 6 symbols from sub_agent_extractor.go: ExtractInlineSubAgents, ValidateInlineSubAgentsFrontmatter, ValidateInlineSubAgentsInBody, GetEngineSubAgentDir, GetEngineSubAgentExt

pkg/workflow/README.md

Three new subsections:

  • Sandbox ConfigurationSandboxConfig, AgentSandboxConfig, SandboxRuntimeConfig, SRTNetworkConfig, SRTFilesystemConfig, SandboxType + SandboxTypeAWF/SandboxTypeDefault constants
  • MCP ScriptsMCPScriptsConfig, MCPScriptToolConfig, MCPScriptParam, MCPScriptsToolJSON, MCPScriptsConfigJSON + MCPScriptsModeHTTP/MCPScriptsDirectory constants + 8 generator functions (GenerateMCPScriptsToolsConfig, GenerateMCPScriptsMCPServerScript, GenerateMCPScriptJavaScriptToolScript, etc.)
  • Workflow Header GenerationGenerateWorkflowHeader(sourceFile, generatedBy, customInstructions string) string

pkg/cli/README.md

~45 types added to the "Additional Exported Types" table, covering recently-added structs that had no spec entries:

Category Representative additions
Audit comparison AuditComparisonClassification, AuditComparisonIntDelta, AuditComparisonMCPFailureDelta, AuditComparisonRecommendation, AuditComparisonStringDelta
Audit diff BashCommandsDiff, FirewallDiff, FirewallDiffSummary, RunMetricsDiff, TokenUsageDiff, ToolCallsDiff, ToolCallsDiffSummary
Gateway / MCP DifcFilteredEvent, GatewayServerMetrics, GatewayToolMetrics, GuardPolicyEvent, MCPServerHealthDetail, MCPToolDiffEntry, MCPToolsDiff, MCPToolUsageSummary
Devcontainer DevcontainerBuild, DevcontainerCodespaces, DevcontainerCustomizations, DevcontainerRepoPermissions, DevcontainerVSCode
Misc AmbientContextMetrics, AwInfoSteps, CopilotWorkflowStep, CreatedItemReport, PollResult, PolicyRule, SafeOutputChainMetrics, WorkflowRun, …

pkg/console/README.md

  • Added formal Public API table under ProgressBar Component documenting NewProgressBar, NewIndeterminateProgressBar, and (*ProgressBar).Update (previously only referenced in prose examples)

…ADMEs

Closes #<issue>"

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/156e0434-ac97-42b1-b6bb-8cf9f967dfca

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix API drift in 4 packages as per specification audit docs: resolve API drift in pkg/parser, pkg/workflow, pkg/cli, pkg/console May 3, 2026
Copilot AI requested a review from gh-aw-bot May 3, 2026 14:09
@pelikhan pelikhan marked this pull request as ready for review May 3, 2026 14:48
Copilot AI review requested due to automatic review settings May 3, 2026 14:48
@github-actions github-actions Bot mentioned this pull request May 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates package READMEs to align published API/spec documentation with recently added exported types and helper functions across parser, workflow, cli, and console.

Changes:

  • Documented workflow sandbox configuration, MCP scripts configuration/generators, and workflow header generation in pkg/workflow/README.md.
  • Added inline sub-agent types and extraction/validation helpers to pkg/parser/README.md.
  • Expanded exported types tables in pkg/cli/README.md and formalized the ProgressBar public API in pkg/console/README.md.
Show a summary per file
File Description
pkg/workflow/README.md Adds spec entries for sandbox config, MCP scripts, and GenerateWorkflowHeader
pkg/parser/README.md Documents inline sub-agent parsing types/functions
pkg/cli/README.md Expands the exported-types spec table to cover newer CLI structs/types
pkg/console/README.md Adds an explicit ProgressBar public API table

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (2)

pkg/workflow/README.md:198

  • SandboxConfig is described as supporting legacy type/config fields, but sandbox.config is now explicitly rejected as deprecated during validation (validateSandboxConfig returns a configuration error when SandboxConfig.Config != nil). The README should mention that sandbox.config is deprecated/invalid and will fail compilation, so readers don’t copy an unsupported example.
| `SandboxType` | string alias | Sandbox type identifier (`"awf"`, `"default"`) |
| `SandboxConfig` | struct | Top-level sandbox configuration; supports new `agent`/`mcp` fields and legacy `type`/`config` fields |
| `AgentSandboxConfig` | struct | Agent-side sandbox configuration (ID, version, command, mounts, memory, env) |
| `SandboxRuntimeConfig` | struct | Anthropic Sandbox Runtime (SRT) configuration (filesystem, network, violations) |

pkg/workflow/README.md:390

  • The customInstructions parameter is documented as being appended “verbatim”, but the implementation trims surrounding whitespace and trims each line before prefixing it as a comment. If callers rely on exact formatting (leading/trailing spaces, blank lines), they won’t get it—please update the wording to reflect the actual behavior.
| `GenerateWorkflowHeader` | `func(sourceFile, generatedBy, customInstructions string) string` | Generates the standard ASCII-art + regeneration-instructions header comment for compiled lock files; `sourceFile` is the `.md` source path, `generatedBy` names the generator, and `customInstructions` is appended verbatim |

  • Files reviewed: 4/4 changed files
  • Comments generated: 4

Comment thread pkg/workflow/README.md
Comment on lines +191 to +200
The sandbox subsystem controls which agent firewall (AWF) or sandbox runtime is used during workflow execution.

| Type | Kind | Description |
|------|------|-------------|
| `SandboxType` | string alias | Sandbox type identifier (`"awf"`, `"default"`) |
| `SandboxConfig` | struct | Top-level sandbox configuration; supports new `agent`/`mcp` fields and legacy `type`/`config` fields |
| `AgentSandboxConfig` | struct | Agent-side sandbox configuration (ID, version, command, mounts, memory, env) |
| `SandboxRuntimeConfig` | struct | Anthropic Sandbox Runtime (SRT) configuration (filesystem, network, violations) |
| `SRTNetworkConfig` | struct | Network configuration for SRT (allowed/blocked domains, Unix sockets) |
| `SRTFilesystemConfig` | struct | Filesystem configuration for SRT (denyRead, allowWrite, denyWrite) |
Comment thread pkg/workflow/README.md

| Function | Signature | Description |
|----------|-----------|-------------|
| `GenerateWorkflowHeader` | `func(sourceFile, generatedBy, customInstructions string) string` | Generates the standard ASCII-art + regeneration-instructions header comment for compiled lock files; `sourceFile` is the `.md` source path, `generatedBy` names the generator, and `customInstructions` is appended verbatim |
Comment thread pkg/console/README.md
|------------------|-----------|-------------|
| `NewProgressBar` | `func(total int64) *ProgressBar` | Creates a determinate progress bar for a known total byte count |
| `NewIndeterminateProgressBar` | `func() *ProgressBar` | Creates an indeterminate progress bar for operations of unknown size (WASM build only) |
| `(*ProgressBar).Update` | `func(current int64) string` | Updates progress and returns a formatted display string; in TTY mode renders a gradient bar, in non-TTY mode returns a text percentage |
Comment thread pkg/cli/README.md
| `InitOptions` | struct | Options for `InitRepository` |
| `JobData` | struct | Data for a single GitHub Actions job |
| `JobInfo` | struct | Metadata for a GitHub Actions job |
| `JobInfoWithDuration` | struct | `JobInfo` extended with a human-readable duration string |
@pelikhan pelikhan merged commit df7a369 into main May 3, 2026
38 of 40 checks passed
@pelikhan pelikhan deleted the copilot/fix-api-drift-in-packages branch May 3, 2026 14:55
@github-actions github-actions Bot restored the copilot/fix-api-drift-in-packages branch May 3, 2026 14:55
@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

Commit pushed: 030802a

🏗️ ADR gate enforced by Design Decision Gate 🏗️

Copilot AI added a commit that referenced this pull request May 3, 2026
…sole (#29925)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specification Audit — 2026-05-03 — API drift found in 4 packages

4 participants